/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejercicios;

import java.util.Scanner;

/**
 *
 * @author zpiik3
 */
public class letras {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       String s;
        System.out.println("introduce una cadena");

        Scanner tec = new Scanner(System.in);
        s = tec.next();
        String [] prueba = s.split(",");
        for(int y=0; y<prueba.length; y+=2){
        Integer num = Integer.parseInt(prueba[y]);
        for (int x=0; x<num; x++){

        System.out.println(prueba[y+1]);

        }
        System.out.println(" ");
        }
    }

}